package com.clpms.dao.mapper;

import com.clpms.dao.pojo.LearnRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author caixinyong
 * @date 2023/5/12 3:49 PM
 */

@Mapper
public interface LearnRecordDao {

    List<LearnRecord> selectByWorkId(@Param("workId") Long workId,
                                     @Param("courseId") Long courseId,
                                     @Param("teacherId") Long teacherId,
                                     @Param("schoolId") Long schoolId,
                                     @Param("status") Integer status);

    List<LearnRecord> selectByWorkIdList(@Param("workIdList") List<Long> workIdList,
                                         @Param("status") Integer status);

    Long insertBatch(@Param("list") List<LearnRecord> list);

    Long selectCountByTeacherId(@Param("teacherId") Long teacherId, @Param("schoolId") Long schoolId);

    List<LearnRecord> selectAllByTeacherId(@Param("teacherId") Long teacherId, @Param("schoolId") Long schoolId);

    List<LearnRecord> selectByCourseId(@Param("courseId") Long courseId);

    Long deleteBatch(@Param("idList") List<Long> idList, @Param("schoolId") Long schoolId,
                     @Param("teacherId") Long teacherId);

    Long deleteByCourseId(@Param("courseId") Long courseId,
                          @Param("schoolId") Long schoolId,
                          @Param("teacherId") Long teacherId);

    Long deleteByWorkId(@Param("workId") Long workId,
                        @Param("schoolId") Long schoolId,
                        @Param("teacherId") Long teacherId);

    Long updateById(@Param("learnRecord") LearnRecord learnRecord);
}
